package com.info.search;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class StreamUtils {

	public static String  Stream2String(InputStream in) throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(
				in));
		String s;
		StringBuffer b = new StringBuffer();
		while ((s = br.readLine()) != null) {
			b.append(s);
		}

		return b.toString();
	}
	public static void save(String s) 
	{
		FileOutputStream out;
		try {
			out = new FileOutputStream("G://Xiaomi//test.html");
			out.write(s.getBytes());
			System.out.println("ok");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}
	
}
